package com.tjsiqi.controller;

import com.tjsiqi.Vo.JbzInfoVo;
import com.tjsiqi.beans.PageQuery;
import com.tjsiqi.common.JsonData;
import com.tjsiqi.param.SendCountParam;
import com.tjsiqi.param.SendCountParamM;
import com.tjsiqi.service.SysSendCountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;


@Controller
@RequestMapping("/sys/SendCount")
public class SysSendCountController {
    @Autowired
    private SysSendCountService sysSendCountService;


    //发货汇总
    @RequestMapping("/SendCount.page")
    public ModelAndView SendCountPage(){
        return new ModelAndView("SendTruckOutCount");
    }

    //管理员查询发货汇总
    @RequestMapping("/SendUnitCount.page")
    public ModelAndView SendUnitCountPage(){
        return new ModelAndView("SendUnitCount");
    }

    //管理员查询发货汇总
    @RequestMapping("/SendNameCount.page")
    public ModelAndView SendNameCountPage(){
        return new ModelAndView("SendNameCount");
    }

    //管理员查询发货汇总
    @RequestMapping("/SendJbzCount.page")
    public ModelAndView SendJbzCountPage(){
        return new ModelAndView("SendJbzCount");
    }


    //按客户
    @RequestMapping("/CustomerPage.json")
    @ResponseBody
    public JsonData getSendCountByCustomer(SendCountParam sendCountParam, PageQuery page){

        return JsonData.success(sysSendCountService.getSendCountByCustomer(sendCountParam,page));
    }

    //按施工单位
    @RequestMapping("/ProUnitPage.json")
    @ResponseBody
    public JsonData getSendCountByProUnit(SendCountParam sendCountParam, PageQuery page){

        return JsonData.success(sysSendCountService.getSendCountByProUnit(sendCountParam,page));
    }

    //按车牌号
    @RequestMapping("/TruckPage.json")
    @ResponseBody
    public JsonData getSendCountByTruck(SendCountParam sendCountParam, PageQuery page){

        return JsonData.success(sysSendCountService.getSendCountByTruck(sendCountParam,page));
    }

    //按业务员
    @RequestMapping("/SenderPage.json")
    @ResponseBody
    public JsonData getSendCountBySender(SendCountParam sendCountParam, PageQuery page){

        return JsonData.success(sysSendCountService.getSendCountBySender(sendCountParam,page));
    }

    //按操作员
    @RequestMapping("/OperatorPage.json")
    @ResponseBody
    public JsonData getSendCountByOperator(SendCountParam sendCountParam, PageQuery page){

        return JsonData.success(sysSendCountService.getSendCountByOperator(sendCountParam,page));
    }

    //按强度等级
    @RequestMapping("/LevelPage.json")
    @ResponseBody
    public JsonData getSendCountByLevel(SendCountParam sendCountParam){

        return JsonData.success(sysSendCountService.getSendCountByLevel(sendCountParam));
    }

    //按生产线
    @RequestMapping("/ProLinePage.json")
    @ResponseBody
    public JsonData getSendCountByProLine(SendCountParam sendCountParam){

        return JsonData.success(sysSendCountService.getSendCountByProLine(sendCountParam));
    }

    //按现场联系人
    @RequestMapping("/LinkManPage.json")
    @ResponseBody
    public JsonData getSendCountByLinkMan(SendCountParam sendCountParam,PageQuery page){

        return JsonData.success(sysSendCountService.getSendCountByLinkMan(sendCountParam,page));
    }

    //按工程名称
    @RequestMapping("/ProPage.json")
    @ResponseBody
    public JsonData getSendCountByPro(SendCountParam sendCountParam,String ProUnit){

      return JsonData.success(sysSendCountService.getSendCountByPro(sendCountParam,ProUnit));
    }

    //联系电话
    @RequestMapping("/ProLinkManPage.json")
    @ResponseBody
    public JsonData getSendCountByProLinkMan(SendCountParam sendCountParam,String ProLinkMan){

        return JsonData.success(sysSendCountService.getSendCountByProLinkMan(sendCountParam,ProLinkMan));
    }


    //管理员查询施工单位汇总
    @RequestMapping("/SendUnitCount.json")
    @ResponseBody
    public JsonData getSendCountByCustomerM(SendCountParamM sendCountParamM, PageQuery page){

        return JsonData.success(sysSendCountService.getSendCountByCustomerM(sendCountParamM,page));
    }

    //管理员查询工程名称汇总
    @RequestMapping("/SendNameCount.json")
    @ResponseBody
    public JsonData getSendCountByNameM(SendCountParamM sendCountParamM, PageQuery page){

        return JsonData.success(sysSendCountService.getSendCountByNameM(sendCountParamM,page));
    }

    //管理员查询搅拌站汇总
    @RequestMapping("/SendJbzCount.json")
    @ResponseBody
    public JsonData getSendCountByJbzM(SendCountParamM sendCountParamM, PageQuery page){

        return JsonData.success(sysSendCountService.getSendCountByJbzM(sendCountParamM,page));
    }


}
